package com.ruoyi.common.core.domain.entity;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 系统用户角色权限信息对象 zx_sysrole
 * 
 * @author ruoyi
 * @date 2021-04-24
 */
public class SysRole extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 标识ID */
    @Excel(name = "标识ID")
    private Long srId;

    /** 角色名称 */
    @Excel(name = "角色名称")
    private String srTitle;

    /** 模块权限集 */
    @Excel(name = "模块权限集")
    private String srMenuStr;

    /** 操作权限集 */
    @Excel(name = "操作权限集")
    private String srOptionStr;

    /** -1禁用1启用 */
    @Excel(name = "-1禁用1启用")
    private Integer srStatus;

    /** 编辑用户 */
    @Excel(name = "编辑用户")
    private Long uId;

    /** 编辑用户名称 */
    private String createdBy;

    /** 排序 */
    private int srSort;

    /** 菜单组 */
    private Long[] menuIds;

    /** 编辑时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "编辑时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date time;

    public SysRole() {
    }

    public SysRole(Long srId) {
        this.srId = srId;
    }

    public void setSrId(Long srId)
    {
        this.srId = srId;
    }

    public Long getSrId()
    {
        return srId;
    }
    public void setSrTitle(String srTitle) 
    {
        this.srTitle = srTitle;
    }

    public String getSrTitle() 
    {
        return srTitle;
    }
    public void setSrMenuStr(String srMenuStr) 
    {
        this.srMenuStr = srMenuStr;
    }

    public String getSrMenuStr() 
    {
        return srMenuStr;
    }
    public void setSrOptionStr(String srOptionStr) 
    {
        this.srOptionStr = srOptionStr;
    }

    public String getSrOptionStr() 
    {
        return srOptionStr;
    }
    public void setSrStatus(Integer srStatus) 
    {
        this.srStatus = srStatus;
    }

    public Integer getSrStatus() 
    {
        return srStatus;
    }
    public void setuId(Long uId)
    {
        this.uId = uId;
    }

    public Long getuId()
    {
        return uId;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public int getSrSort() {
        return srSort;
    }

    public void setSrSort(int srSort) {
        this.srSort = srSort;
    }

    public void setTime(Date time) 
    {
        this.time = time;
    }

    public Date getTime() 
    {
        return time;
    }

    public boolean isAdmin(){
        Long srId = this.getSrId();
        return srId==0;
    }

    public Long[] getMenuIds() {
        return menuIds;
    }

    public void setMenuIds(Long[] menuIds) {
        this.menuIds = menuIds;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("srId", getSrId())
            .append("srTitle", getSrTitle())
            .append("srMenuStr", getSrMenuStr())
            .append("srOptionStr", getSrOptionStr())
            .append("srStatus", getSrStatus())
            .append("uId", getuId())
            .append("time", getTime())
            .toString();
    }
}
